{{--
/**
 * Created by PhpStrom
 * User: 郭碧云
 * Date: 2021/3/9 15:07
 * Desc:
 */--}}
<div class="layui-card-body ">
    <form class="layui-form" method="post" @if($error>0) @else action="{{ session('guard')=="admin"?route("admin.role.update",["id"=>$role->id]):route("system.role.update",["id"=>$role->id]) }}" @endif id="edit-form">
        @csrf
        <div class="layui-form-item">
            <label class="layui-form-label">角色名称</label>
            <div class="layui-input-block">
                <input type="text" name="data[name]" required @if($error>0) @else value="{{$role->name}}" @endif lay-verify="required" placeholder="请输入角色名称" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">守卫</label>
            <div class="layui-input-block">
                <select id="type" name="data[guard_name]" disabled lay-verify="required">
                    {!! Code::getOptionsByCode('GUARD','',$role->guard_name) !!}
                </select>
            </div>
        </div>

        <div class="layui-form-item" id="is_system">
            <label class="layui-form-label">选择类型</label>
            <div class="layui-input-block">
                <input type="radio" name="is_system" value="1" title="系统" @if(session("guard")=="admin") disabled @endif @if($role->is_system==1) checked @endif>
                <input type="radio" name="is_system" value="0" title="通用" @if(session("guard")=="admin") disabled @endif @if($role->is_system==0) checked @endif>
            </div>
        </div>

    </form>
</div>
